grammar Rows;

//add member to generated rowParser
@parser::members {
    int col;
    //    custom constructor
    public RowsParser(TokenStream input, int col) {
        this(input);
        this.col = col;
    }
}

file: (row NL)+ ;

row
locals [int i=0]
    : (
        STUFF
        {
            $i++;
            if ($i == col) {
                System.out.println($STUFF.text);
            }
        }
    )+
    ;

//modify file splited by ';'
SPLIT:    [; ] -> skip;
NL:     '\r'? '\n';
STUFF:  ~[\t\r\n;]+;